<?php
namespace App\Http\Controllers\Admin;

use App\Modules\User\User;

class Home extends AdminParent
{

    /**
     * 后台首页
     * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View|\think\response\View
     * @throws \App\Exceptions\RequestFailException
     */
    public function countinfo()
    {
        # 用户统计
//        $userCount = $this->appLayerExec(User::class, 'userIncreTendency');
//
//        return view('admin.home.countinfo', [
//            'user_count'    => $userCount
//        ]);
//        $phpWord = new \PhpOffice\PhpWord\PhpWord();
//        $section = $phpWord->addSection();
//        $desc = "Learn from yesterday, live for today, hope for tomorrow.";
//        $section->addText($desc);
//        $objWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, 'Word2007');
//        $objWriter->save(storage_path('helloWorld.docx'));
        //return response()->download(storage_path('helloWorld.docx'));
//        $templateProcessor = new \PhpOffice\PhpWord\TemplateProcessor(storage_path('qq.docx'));
//        $templateProcessor->setValue('time', date('Y-m-d H:i:s'));
//        $templateProcessor->saveAs(storage_path('my.docx'));
//        dd($templateProcessor);
//        $templateProcessor->setValue('Name', 'John Doe');

    }

    /**
     * 简介
     * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View|\think\response\View
     */
    public function systeminfo()
    {
        return view('admin.home.systeminfo');
    }
}